import request from '@/utils/request'
import API from './BaseApi'


// 用户登录
export function login (data) {
  return request({
    url: API.ADMIN_URL + '/sys/user/login',
    method: 'post',
    data: data
  })
}

// 刷新token
export function refresh (params) {
  return request({
    url: API.ADMIN_URL + '/sys/user/refresh',
    method: 'get',
    params: params
  })
}

// 查询用户列表
export function getUserList (params) {
  return request({
    url: API.ADMIN_URL + '/sys/user/list',
    method: 'get',
    params: params
  })
}

// 用户个人详情信息
export function personal (params) {
  return request({
    url: API.ADMIN_URL + '/sys/user/personal',
    method: 'get',
    params: params
  })
}

// 修改用户信息
export function updateUser (data) {
  return request({
    url: API.ADMIN_URL + '/sys/user/update',
    method: 'post',
    data: data
  })
}

// 查询任务列表
export function getJobList (params) {
  return request({
    url: API.JOB_URL + '/job/list',
    method: 'get',
    params: params
  })
}

// 添加任务
export function addJob (data) {
  return request({
    url: API.JOB_URL + '/job/add',
    method: 'post',
    data: data
  })
}

// 开始任务
export function startJob (params) {
  return request({
    url: API.JOB_URL + '/job/start',
    method: 'get',
    params: params
  })
}

// 停止任务
export function stopJob (params) {
  return request({
    url: API.JOB_URL + '/job/stop',
    method: 'get',
    params: params
  })
}

// 继续任务
export function proceedJob (params) {
  return request({
    url: API.JOB_URL + '/job/proceed',
    method: 'get',
    params: params
  })
}

// 删除任务
export function deleteJob (params) {
  return request({
    url: API.JOB_URL + '/job/delete',
    method: 'get',
    params: params
  })
}

// 重置任务状态
export function resetJobStatus (params) {
  return request({
    url: API.JOB_URL + '/job/reset',
    method: 'get',
    params: params
  })
}

// 查询系统活动
export function getSysActivityList (params) {
  return request({
    url: API.ADMIN_URL + '/sys/activity/list',
    method: 'get',
    params: params
  })
}

// 添加系统活动
export function addSysActivity (data) {
  return request({
    url: API.ADMIN_URL + '/sys/activity/add',
    method: 'post',
    data: data
  })
}

// 删除系统活动
export function deleteSysActivity (params) {
  return request({
    url: API.ADMIN_URL + '/sys/activity/delete',
    method: 'get',
    params: params
  })
}

// 同步系统活动
export function syncSysActivity (params) {
  return request({
    url: API.ADMIN_URL + '/sys/activity/sync',
    method: 'get',
    params: params
  })
}
